import requests
import time
import math
import random
import pywasm
url='https://match.yuanrenxue.com/api/match/15'
t1=int(time.time()/2)
t2=int(time.time()/2-math.floor(random.random()*50+1))
func=pywasm.load('main.wasm')
t0=func.exec('encode',[t1,t2])
headers = {
        "User-Agent": "yuanrenxue.project",
        'Cookie': 'sessionid=84rfzmmclgdvknl834a394ole9kmxdmk'
    }
all_sum=0
for page in range(1,6):
    params={
        'page':page,
        'm':f'{t0}|{t1}|{t2}'
    }
    response=requests.get(url,headers=headers,params=params).json()
    value_sum=0
    for i in response.get('data'):
        value_sum+=i.get('value')
    print(f'第{page}页和',value_sum)
    all_sum+=value_sum
print(f'{page}页总和为',all_sum)